Skip to content

XSort insertionSort improvements. #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2024
Merged

XSort insertionSort improvements. #158

merged 2 commits into from
Nov 22, 2024

Conversation

fh-ms
Copy link
Contributor

@fh-ms fh-ms commented Nov 22, 2024

No description provided.

@fh-ms fh-ms requested a review from zdenek-jonas November 22, 2024 12:03
@fh-ms fh-ms self-assigned this Nov 22, 2024
@zdenek-jonas
Copy link
Contributor

Tested with:

    @Test
    void insertionsort_int_bound()
    {
        int[] input = new int[]{5, 2, 9, 1, 8};

        XSort.insertionsort(input,2,5);

        int[] expected  = new int[]{5, 2, 1, 8, 9};
        Assertions.assertArrayEquals(expected, input);
    }

    @Test
    void insertionsort_int_comparator_bound()
    {
        Integer[] input = new Integer[]{5, 2, 9, 1, 8};

        XSort.insertionsort(input,Comparator.naturalOrder(), 2,5);

        Integer[] expected  = new Integer[]{5, 2, 1, 8, 9};
        Assertions.assertArrayEquals(expected, input);
    }

@fh-ms fh-ms added this to the 2.1.0 milestone Nov 22, 2024
@fh-ms fh-ms merged commit 0f593db into main Nov 22, 2024
8 checks passed
@fh-ms fh-ms deleted the sort-improvements branch November 22, 2024 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants